/*
**  Copyright (c) 2014 Michael Liu(michael.liu.point@gmail.com).
**
**  Project: Gateway Unified Management Platform
**  File:      pfdep.h
**  Author:  Michael
**  Date:    03/20/2014
**
**  Purpose:
**    platform depend defines.
*/

#ifndef __PLATFORM_DEP_H__
#define __PLATFORM_DEP_H__

#ifdef __cplusplus
extern "C" {
#endif				/* __cplusplus */

/* Include files. */

#include "common.h"
#include "cmrc.h"
#include "list.h"
#include "dpmgr.h"
#include "eamgr.h"
#include "samgr.h"
#include "pfdep_if.h"

/* Macro constant definitions. */

#define PF_DEP_DEFAULT_IP_ADDR			"192.168.2.1"
#define PF_DEP_DEFAULT_NET_MASK			"255.255.255.0"
#define PF_DEP_DEFAULT_GATEWAY			"192.168.2.2"
#define PF_DEP_MANAGEMENT_URL			"repeater.askey.com"

#define PF_DEP_HOSTNAME					"Askey-Repeater"

#define PF_DEP_2860_DEFAULT_SETTING		"/etc_ro/nvram_rt2860_default"
#define PF_DEP_RTDEV_DEFAULT_SETTING	"/etc_ro/nvram_rtdev_default"
#define PF_DEP_2860_COMMAND				"rt2860_nvram_show"
#define PF_DEP_RTDEV_COMMAND			"rtdev_nvram_show"
#define PF_DEP_2860_SETTING				"/tmp/nvram_rt2860"
#define PF_DEP_RTDEV_SETTING			"/tmp/nvram_rtdev"
#define PF_DEP_CONFIG_FILR				"/tmp/config_file"

/* Type definitions. */

/* External function declarations. */

	extern e_ret pf_dep_set_device_mode(unsigned char mode);
	extern e_ret pf_dep_get_device_mode(unsigned char *mode);

	extern e_ret pf_dep_dev_init(tdp_dev * dp_dev);
	extern e_ret pf_dep_dev_config(tdp_dev * dp_dev);
	extern e_ret pf_dep_dev_clean(tdp_dev * dp_dev);

	extern e_ret pf_dep_sa_setup(void);
	extern e_ret pf_dep_dp_setup(void);

	extern e_ret pf_dep_cfg_check(void);
	extern e_ret pf_dep_cfg_init(void);
	extern e_ret pf_dep_cfg_close(void);
	extern e_ret pf_dep_cfg_save(void);

	extern e_ret pf_dep_get_fminfo(tversion * fw_info);
	extern e_ret pf_dep_check_password(const char *password, unsigned char *ok);
	extern e_ret pf_dep_set_password(const char *password);
	extern e_ret pf_dep_get_password(char *password);
	extern e_ret pf_dep_set_qis(unsigned char qis_done);
	extern e_ret pf_dep_get_qis(unsigned char *qis_done);
	extern e_ret pf_dep_set_ntp(char *ntpserver);
	extern e_ret pf_dep_get_ntp(char *ntpserver);
	extern e_ret pf_dep_set_timezone(const unsigned int timezone);
	extern e_ret pf_dep_get_timezone(unsigned int *timezone);
	extern e_ret pf_dep_get_language(unsigned char *lang);
	extern e_ret pf_dep_set_language(unsigned char lang);
	extern e_ret pf_dep_reboot();
	extern e_ret pf_dep_dump_cfg(char *cfg_file);
	extern e_ret pf_dep_load_cfg(char *cfg_file);
	extern e_ret pf_dep_reset_cfg();
	extern e_ret run_ntpclient_update_time(const char *netserver);
	extern e_ret pf_dep_do_local_upgrade(tsys_admin * sa, char *fw_file);
	extern e_ret pf_dep_start_fota_check();
	extern e_ret pf_dep_query_fota_check();
	extern e_ret pf_dep_cancel_fota_check();
	extern e_ret pf_dep_start_fota_upgrade(tsys_admin * sa);
	extern e_ret pf_dep_query_fota_upgrade();
	extern e_ret pf_dep_cancel_fota_upgrade();
	extern e_ret pf_dep_do_fota_check(tsys_admin * sa);
	extern e_ret pf_dep_set_country(tdata_paths * dp, unsigned int country_number);
	extern e_ret pf_dep_get_country(unsigned int *country_number);
	extern e_ret pf_dep_get_devmac(tdevmac * devmac);

/* Macro API definitions. */

/* Global variable declarations. */

#ifdef __cplusplus
}				/* extern "C" */
#endif				/* __cplusplus */
#endif				/* __PLATFORM_DEP_H__ */
